package com.qjdchina.sku.boss.web.controller;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.qjdchina.common.web.util.RestBody;
import com.qjdchina.commons.model.PageModel;
import com.qjdchina.sku.biz.SkuCompanyManager;
import com.qjdchina.sku.model.vo.SkuCompanyVO;
import com.qjdchina.sku.service.enums.SkuResultCode;

/**
 * 公司
 * @author shenpingfeng
 * 2017年1月5日
 */
@Controller
@RequestMapping(value = "company")
public class CompanyController {

	public static final Logger LOGGER = LoggerFactory.getLogger(CompanyController.class);
	@Autowired
	private SkuCompanyManager skuCompanyManager;
	
	/**
	 * 查询
	 * shenpingfeng
	 * 2017年2月14日
	 * @param strPage
	 * @param request
	 * @return
	 */
	@RequestMapping(value = "query", method = RequestMethod.GET)
	@ResponseBody
	public RestBody<PageModel<SkuCompanyVO>> query(
			@RequestParam(value = "pageNo", required = false) String strPage,HttpServletRequest request) {
		
		return new RestBody<PageModel<SkuCompanyVO>>(SkuResultCode.SUCCESS);

	}
	
	/**
	 * 更新
	 * shenpingfeng
	 * 2017年2月14日
	 * @param skuCompanyVO
	 * @param request
	 * @return
	 */
	@RequestMapping(value = "update", method = RequestMethod.POST)
	@ResponseBody
	public RestBody<Integer> update(SkuCompanyVO skuCompanyVO,HttpServletRequest request) {
		skuCompanyManager.updateSkuCompany(skuCompanyVO);
		return new RestBody<Integer>(SkuResultCode.SUCCESS);

	}
	
	

}
